import java.util.List;
import java.util.ArrayList;

public class GroupCapsule {
	List<GroupObject> groupObjects;

	public List<GroupObject> getGroupObjects() {
		return groupObjects;
	}

	public void setGroupObjects(List<GroupObject> groupObjects) {
		this.groupObjects = groupObjects;
	}
	public GroupCapsule(List<GroupObject> groupObjs)
    {
        groupObjects = groupObjs;
    }
	
	public void addGroup(GroupObject go)
	{
		groupObjects.add(go);
	}

    public List<Lambda> returnLambdas()
    {
        List<Lambda> returnLambdas = new ArrayList<Lambda>();
        for (GroupObject go : groupObjects)
        {
            for (BlockObject bo : go.getObjects())
            {
                if(bo instanceof Lambda)
                {
                    returnLambdas.add((Lambda)bo);
                }
            }
        }
        return returnLambdas;
    }
}
